using System;

namespace Phoenix.Diagnostics
{
    public class SystemTraceListener : ITraceListener
    {
        public void Write(DateTime logTime, TraceLevel traceLevel, string category, Type sourceType, string traceMessage, string formattedMessage)
        {
#if WINDOWS_PHONE
            var phoenixApplication = System.Windows.Application.Current as PhoenixApplication;
            if (phoenixApplication != null)
            {
                (phoenixApplication).WriteTrace(formattedMessage, category);
            }
#else
            System.Diagnostics.Trace.Write(formattedMessage, category);
#endif
        }
    }
}